package com.mengshuai.technology.order.rocketmq.consumer;

import com.mengshuai.technology.order.rocketmq.topic.TopicConstant;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * 消费者组B - 集群模式消费TopicB
 *
 * @author ms
 * @since 2025/06/25
 */
@RocketMQMessageListener(
    topic = TopicConstant.TOPIC_B ,
    consumerGroup = "${rocketmq.consumer.groupB.group}", // 引用独立配置
    messageModel = MessageModel.CLUSTERING
)
@Service
public class TopicBClusterConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println("TopicBClusterConsumer [集群] 消费消息: " + message);
    }
}
